<!DOCTYPE html>
<html>
  <head>
     <meta charset="UTF-8">
    <title>post page</title>
    <link rel='stylesheet' href='/stylesheets/style.css' />
    <link rel="stylesheet" href="/editormd/css/editormd.min.css" />
  </head>
  <body>
    <div class="container">
      <h1>write artitle</h1>
      <form id="post_form" action="/articles" method="POST">
          <div>
            <div>title</div>
            <input type="text" name="title"/>
          </div>
          <div>
            <div>content</div>
            <div id="editormd">
              <textarea style="display:none;" name="content"></textarea>
            </div>
          </div>
          <div> 
            <div>label</div>
            <input type="text" name="labels" id="label-field"/>
          </div>
          <div>
              <input type="submit" value="submit"/>
          </div>
      </form>
    </div>
    <script type="text/javascript" src="/javascripts/jquery-3.1.1.min.js"></script>
    <script type="text/javascript" src="/editormd/editormd.min.js"></script>
    <script type="text/javascript">
        $(function() {
          var editor = editormd({
              id:"editormd",
              path : "/editormd/lib/",
              height:500
          });

          var post_form=$("#post_form");
          post_form.keydown(function(){
            if(event.keyCode==13)
              return false;
            else
              return true;
          });

          post_form.keyup(function(){
            
          });
        });
        
    </script>
  </body>
</html>
